package client;

import com.google.gwt.user.client.rpc.*;
import java.util.*;

/**
 * Contact
 *
 * This class is used to store contact information.
 * The contact information consists of:
 *    - Contact Name
 *    - Contact Email address
 *    - Contact street address
 *    - Contact phone number
 *
 * @author Masud Idris
 * @version 1.0
 * @since Dec 18, 2007, 9:22:54 PM
 *
 */
public class Contact implements IsSerializable {
  /**
   * HashMap that will always contain strings for both keys and values
   * @gwt.typeArgs <java.lang.String, java.lang.String>
   */
  private HashMap contactInfo;


  /**
   * Default Constructor
   */
  public Contact() {
    contactInfo = new HashMap();
    contactInfo.put("name", "");
    contactInfo.put("email", "");
    contactInfo.put("address", "");
    contactInfo.put("phone", "");
  }


  /**
   * Method used to set the contact's name
   * @param name  contact's name
   */
  public void setName(String name) {
    contactInfo.put("name", name);
  }


  /**
   * Method used to set the contact's email address
   * @param email  contact email address
   */
  public void setEmail(String email) {
    contactInfo.put("email", email);
  }


  /**
   * Method used to set the contact's street address
   * @param address contact's street address
   */
  public void setAddress(String address) {
    contactInfo.put("address", address);
  }


  /**
   * Method used to set the contact's phone number
   * @param phoneNumber contact's phone number
   */
  public void setPhoneNumber(String phoneNumber) {
    contactInfo.put("phone", phoneNumber);
  }


  /**
   * Method used to get the contact's name
   * @return  contact's name
   */
  public String getName() {
    return (String) contactInfo.get("name");
  }


  /**
   * Method used to get the contact's email address
   * @return  contact's email address
   */
  public String getEmail() {
    return (String) contactInfo.get("email");
  }


  /**
   * Method used to get the contact's street address
   * @return  contact's street address
   */
  public String getAddress() {
    return (String) contactInfo.get("address");
  }


  /**
   * Method used to get the contact's phone number
   * @return  contact's phone number
   */
  public String getPhoneNumber() {
    return (String) contactInfo.get("phone");
  }
  
}//end class Contact
